<?php
if (!defined("IN_OP"))
{
    exit("You can't access this file directly...");
}
if (!( $curruser['account'] == G_SUPERACCOUNT && $curruser['acl'] == 255 ))
{
    exit();
}
$gametype = intval(getvar("gametype"));
$gType = chkGametype($gametype);
if (intval(getvar("clearFlag")))
{
    getdb("TRUNCATE TABLE  `dblog`");
    header("location:op.php?op=admin&fp=showdblog&gametype={$gametype}");
    exit();
}
switch ($gType)
{
    case 0 :
        $ui = new UI();
        if ($curruser['prev_id'] == 0)
        {
            include( "admin_menu.php" );
        }
        else
        {
            include( "admin_menu1.php" );
        }
        $tbl = "";
        break;
    default :
        include_once( "class_3d/CheckMode_3d.php" );
        $chk = new CheckMode_3d($curruser['acl'], 1, $gametype);
        $chk->checkShow3dPage();
        unset($chk);
        $ui = new UI_3D();
        $jslink = "<script language=\"JScript.Encode\" src=\"site.js\"></script>" . ( "<script language=\"VBScript.Encode\" src=\"site.vbs\"></script>" );
        $ui->set("jslink", $jslink);
        $ui->header();
        if ($curruser['prev_id'] == 0)
        {
            include( "admin_menu_3d.php" );
        }
        else
        {
            include( "admin_menu1_3d.php" );
        }
        $tbl = "_" . $g_gametype_3d[$gametype]['en'];
        $tbl02 = $g_gametype_3d[$gametype]['en'];
        break;
}
$tpl = new template2();
$tpl->load("main", "showdblog.htm");
$page = intval(getvar("page"));
if ($page == 0)
{
    $page = 1;
}
$sql = "SELECT * FROM dblog where 1 ORDER BY id DESC";
$rs = getdb($sql, $page, 20);
$list = "";
if ($rs->eof)
{
    $list = "<tr class=td2><td colspan=4 align=center><font color='#00AA22'>查无资料</font></td></tr>";
}
else
{
    while (!$rs->eof)
    {
        $list .= "<tr class=td2>";
        $list .= "<td align=center>" . $rs->f['id'] . "</td>";
        $list .= "<td>" . $rs->f['ctime'] . "</td>";
        $list .= "<td>" . $rs->f['ip'] . "</td>";
        $list .= "<td>" . $rs->f['logs'] . "</td>";
        $list .= "</tr>";
        $rs->movenext();
    }
    $rs->close();
    $tpl->set("button", $rs->pagelink());
}
$optStr = "&nbsp;&nbsp;<a href=\"javascript:chkAgain();\" class=\"colorBtn01 clrBrd_" . $gametype . "\" style=\"padding:5px;\" >清空DBLOG</a>";
$optStr .= "&nbsp;&nbsp;<a href=\"op.php?op=admin&fp=unusualbet&gametype=" . $gametype . "\" class=\"colorBtn01 clrBrd_" . $gametype . "\" style=\"padding:5px;\" >回查询异常注单列表</a>";
$tpl->set(array("optStr" => $optStr, "list" => $list, "gametype" => $gametype));
$tpl->show("main");
$ui->footer();
?>